home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * Resource ID constants.
- */
- # define appleID 128
- # define fileID 129
- # define editID 130
- # define optionsID 131
- # define fontID 132
- # define sizeID 133
- # define linkDisplayID 134
-
- /* MyMenus[] array indexes */
- # define appleMenu 0
- # define aboutMeCommand 1
-
- # define fileMenu 1
- # define newCommand 1
- # define openCommand 2
- # define closeCommand 3
- # define saveCommand 4
- # define quitCommand 6
-
- # define editMenu 2
- # define undoCommand 1
- # define cutCommand 3
- # define copyCommand 4
- # define pasteCommand 5
- # define clearCommand 6
- /* The IAC Commands!! */
- # define hotCopyCommand 8
- # define hotPasteCommand 9
- # define zapLinkCommand 10
-
- # define optionsMenu 3
- # define showLinksCmd 1
- # define showLinkInfoCmd 2
-
- # define fontMenu 4
-
- # define sizeMenu 5
-
- # define linkdDispMenu 6
-
- # define menuCount 7
-
- /* windows, dialogs, and alerts */
- # define windowID 128
- # define ABOUT_DLOG 128
- # define ABOUT_LINKS 129
- # define NO_IAC 256
- # define IAC_ERR_ALRT 257
- # define NOT_IN_EXT 258
- # define KILL_EXT 259
- # define SAVE_CHANGES 260
-
- # define BS 0x08
- # define POLL_INT 60
- # define SLEEP 20
-
- /* Formats supported by the IAC driver are normal resource types */
- # define TXT_FMT 0x54455854
-
- /* Error codes returned by the IAC driver */
- # define NO_MORE_DOCS -2000
- # define NO_MORE_SLOTS -2001
- # define WRITE_FAILED -2002
- # define MISSING_LINK -2003
- # define NO_NEWER_ED -2004
- # define READ_FAILED -2005
- # define NO_SUCH_DEP -2006
- # define OLD_ROMS -2007
-
- /*
- * Information records associated with a window
- */
-
- typedef struct {
- long src_doc; /* doc_ID of source doc */
- short hat_check; /* identifier for an extent */
- short ed_level; /* edition for extent */
- short ext_strt; /* start of extent range */
- short ext_end; /* end of extent range */
- } extent, *extentP, *exTable, **extentH;
-
- typedef struct {
- short the_slot; /* slot_ID for this document */
- long doc_ID; /* document ID for this doc */
- short ext_cnt; /* number of extents with this doc */
- short relevent; /* # un-updated extents */
- extentH the_extents; /* block of extent records */
- TEHandle wind_TEH; /* TEHandle for this window */
- Boolean dirty; /* doc needs saving */
- String(63) doc_file_nm; /* if null, never been saved */
- } win_data, *win_dataP, **win_dataH;
-
- /****
- * Global Data objects, used by routines external to main().
- ***/
-
- #ifndef PUBLIC
- #define PUBLIC
- #undef NO_INIT
- #else
- #define NO_INIT
- #endif
-
- PUBLIC MenuHandle MyMenus[menuCount]; /* The menu handles */
- PUBLIC Boolean DoneFlag; /* Becomes true when File:Quit chosen */
- PUBLIC TEHandle TextH; /* The TextEdit handle */
- PUBLIC CursHandle ibeamHdl;
- PUBLIC WindowPtr myWindow; /* the text window */
- PUBLIC WindowRecord wRecord; /* where to store the window stuff */
- PUBLIC win_dataH the_data_H; /* data associated with a window */
- PUBLIC short fRef; /* refnum for document file */
- PUBLIC short the_fNum, the_size; /* text attributes */
- PUBLIC Style the_style;
- PUBLIC extent curr_ext; /* latest extent worked on */
- PUBLIC short curr_ext_no; /* index of curr_ext */
- PUBLIC Boolean ext_active; /* Is there an active extent? */
- PUBLIC long last_poll; /* when we last polled IAC */
-
- /* f_sizes & f_styles are used in the menu_tree() processing and are read only */
-
- #ifdef NO_INIT
- PUBLIC short extent_count; /* links we are target of */
- PUBLIC Boolean link_menu; /* link menu has been created */
- PUBLIC short f_sizes[8];
- PUBLIC Style f_styles[5];
- #else
- PUBLIC short extent_count = 0;
- PUBLIC Boolean link_menu = false;
- PUBLIC short f_sizes[8] = {9, 10, 12, 14, 16, 20, 24, 28};
- PUBLIC Style f_styles[5] = {bold, italic, underline, outline, shadow};
- #endif
-
- /*
- * HIWORD and LOWORD macros, for readability.
- */
- # define HIWORD(aLong) (((aLong) >> 16) & 0xFFFF)
- # define LOWORD(aLong) ((aLong) & 0xFFFF)
-
-